package com.example.activiti.util;

public class NodeTest {
    static Node a,b;

    static{
        a = new Node(1);
        a.next = new Node(2);
        a.next.next = new Node(3);
        b = a;
    }

    static class Node{
        private int value;
        private Node next;

        Node(int value) {
            this.value = value;
        }
    }

    public static void main(String[] args) {
        Node c = new Node(b.value);
        c.next = a;
        a = c;
        b = b.next;
        System.err.println("A:");
        while (a != null){
            System.err.println(a.value);
            a = a.next;
        }
        System.err.println("B:");
        while (b != null){
            System.err.println(b.value);
            b = b.next;
        }
    }
}
